home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / mini_poo.swf / scripts / DefineSprite_6_hitter / frame_1 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  688 b   |  34 lines

  1. this.onMouseUp = function()
  2. {
  3.    startAnimate = true;
  4. };
  5. dp = 2;
  6. this.onEnterFrame = function()
  7. {
  8.    if(startAnimate)
  9.    {
  10.       pos2 = int(pos / 6) + 1;
  11.       this.rod._x += this.dx;
  12.       count++;
  13.       if(count == 8)
  14.       {
  15.          _root.startBall(_rotation,pos2);
  16.          this.dx = 0;
  17.          return undefined;
  18.       }
  19.       if(count > 16)
  20.       {
  21.          this.removeMovieClip();
  22.       }
  23.    }
  24.    else
  25.    {
  26.       this._rotation = 57.29577951308232 * Math.atan2(_root._ymouse - _Y,_root._xmouse - _X);
  27.       pos += dp;
  28.       pos <= 60 ? null : (dp = -2);
  29.       pos >= 1 ? null : (dp = 2);
  30.       rod._x = -20 - pos;
  31.       this.dx = pos / 8;
  32.    }
  33. };
  34.